class Solution(object):
    def numOfSubarrays(self, arr, k, threshold):
        t = k *threshold
        ans = 0
        now = sum(arr[:k])
        ans += now >= t
        for i in range(len(arr) - k):
            now += arr[i + k] - arr[i]
            ans += now >= t
        return ans